home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / larn.lha / header.h < prev    next >
C/C++ Source or Header  |  1995-11-19  |  4KB  |  122 lines

  1. /*  header.h        Larn is copyrighted 1986 by Noah Morgan. */
  2.  
  3. #ifdef MSDOS
  4. #   define LARNHOME ""
  5. #endif
  6.  
  7. #ifdef AMIGA
  8. #   define LARNHOME "LARN:"
  9. #endif
  10.  
  11. #ifndef WIZID
  12. #   define WIZID  1000
  13. #endif
  14.  
  15. #define TRUE 1
  16. #define FALSE 0
  17.  
  18. #ifdef VMS
  19. #define unlink(x)   delete(x)    /* remove a file */
  20. #endif
  21.  
  22. #define SCORENAME   "larn.scr"
  23. #define LOGFNAME    "larn.log"
  24. #define HELPNAME    "larn.hlp"
  25. #define LEVELSNAME  "larn.maz"
  26. #define FORTSNAME   "larn.ftn"
  27. #define PLAYERIDS   "larn.pid"
  28. #define HOLIFILE    "holidays"
  29. #ifdef MSDOS
  30. #   define LARNOPTS "larn.opt"
  31. #   define SAVEFILE "larn.sav"
  32. #   define SWAPFILE "larn.swp"
  33. #   define CKPFILE  "larn.ckp"
  34. #else
  35. # ifdef VMS
  36. #   define LARNOPTS "larn.opt"
  37. #   define SAVEFILE "larn.sav"
  38. #   define CKPFILE  "larn.ckp"
  39. # else
  40. #   define LARNOPTS ".larnopts"
  41. #   define SAVEFILE "Larn.sav"
  42. #   define CKPFILE  "Larn.ckp"
  43. # ifndef AMIGA
  44. #   define MAIL     /* disable the mail routines for MSDOS */
  45. # endif AMIGA
  46. # endif VMS
  47. #endif MSDOS
  48.  
  49. #define MAXLEVEL 11    /*  max # levels in the dungeon         */
  50. #define MAXVLEVEL 3    /*  max # of levels in the temple of the luran  */
  51. #define MAXX 67
  52. #define MAXY 17
  53.  
  54. #define SCORESIZE 10    /* this is the number of people on a scoreboard max */
  55. #define MAXPLEVEL 100   /* maximum player level allowed        */
  56. #define SPNUM 38        /* maximum number of spells in existance   */
  57. #define TIMELIMIT 30000 /* maximum number of moves before the game is called */
  58. #define TAXRATE 1/20    /* tax rate for the LRS */
  59.  
  60.  
  61. /*  this is the structure that holds the entire dungeon specifications  */
  62. struct cel
  63.     {
  64.     short   hitp;   /*  monster's hit points    */
  65.     char    mitem;  /*  the monster ID          */
  66.     char    item;   /*  the object's ID         */
  67.     short   iarg;   /*  the object's argument   */
  68.     char    know;   /*  have we been here before*/
  69.     };
  70.  
  71. /* this is the structure for maintaining & moving the spheres of annihilation */
  72. struct sphere
  73.     {
  74.     struct sphere *p;   /* pointer to next structure */
  75.     char x,y,lev;       /* location of the sphere */
  76.     char dir;           /* direction sphere is going in */
  77.     char lifetime;      /* duration of the sphere */
  78.     };
  79.  
  80. # ifdef MSDOS
  81. /* Since only 1 level is needed at one time, each level can be swapped
  82.  * to disk if there is not enough memory to allocate it.  Thus, there
  83.  * need only be room for 1 level.  When a level is needed, if it is
  84.  * already in memory, there is nothing to do.  If it isn't, get it from
  85.  * disk after swapping out the oldest level - dgk.
  86.  */
  87. # define FREEBLOCK  -99
  88. typedef struct _ramblock RAMBLOCK;
  89. typedef struct _diskblock DISKBLOCK;
  90. struct _ramblock {
  91.     RAMBLOCK    *next;          /* For a linked list */
  92.     int     level;          /* Level stored or FREEBLOCK */
  93.     long        gtime;          /* The time stored */
  94.     struct  cel cell[MAXX * MAXY];  /* The storage */
  95. };
  96. struct _diskblock {
  97.     DISKBLOCK   *next;          /* For linked list */
  98.     int     level;          /* Level stored or FREEBLOCK */
  99.     long        gtime;          /* The time stored */
  100.     long        fpos;           /* The disk position */
  101. };
  102. extern RAMBLOCK *ramblks;
  103. extern DISKBLOCK *diskblks;
  104.  
  105. # endif MSDOS
  106.  
  107. # ifdef MSDOS
  108. #  define NULL 0L       /* For large model only */
  109. # else
  110. #  define NULL 0
  111. # endif MSDOS
  112. #define BUFBIG  4096            /* size of the output buffer */
  113. #define MAXIBUF 4096            /* size of the input buffer */
  114. #define LOGNAMESIZE 40          /* max size of the players name */
  115. #define PSNAMESIZE 40           /* max size of the process name */
  116. #define SAVEFILENAMESIZE 128    /* max size of the savefile path */
  117.  
  118. #ifdef AMIGA
  119. #define vread read
  120. #define exit(n) {AmEnd();exit(n);}
  121. #endif AMIGA
  122.